package cn.golxen.rsms.controller;

import cn.golxen.rsms.bean.bo.BusinessDateBo;
import cn.golxen.rsms.bean.bo.BusinessSalesFlowBo;
import cn.golxen.rsms.commons.Result;
import cn.golxen.rsms.service.BusinessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping(value = "/business")
public class BusinessController {
    @Autowired
    BusinessService businessService;

    @PostMapping(value = "/get/businessIncomeByHour")
    public Result getBusinessIncomeByHour(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getBusinessIncome(bo));
    }

    @PostMapping(value = "/get/businessIncomeByDays")
    public Result getBusinessIncomeByDays(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getBusinessIncome(bo));
    }
    @PostMapping(value = "/get/businessIncomeReconcileByPayment")
    public Result getBusinessIncomeReconcileByPayment(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getBusinessIncomeReconcileByPayment(bo));
    }

    @PostMapping(value = "/get/businessIncomeReconcileByType")
    public Result getBusinessIncomeReconcileByType(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getBusinessIncomeReconcileByType(bo));
    }

    @PostMapping(value = "/get/businessSalesFlow")
    public Result getBusinessSalesFlow(@RequestBody BusinessSalesFlowBo bo){
        return Result.successResult(businessService.getBusinessSalesFlow(bo));
    }

    @PostMapping(value = "/get/businessAnalysisReport")
    public Result getBusinessAnalysisReport(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getBusinessAnalysisReport(bo));
    }

    @PostMapping(value = "/get/businessAnalysisReportByGoods")
    public Result getBusinessAnalysisReportByGoods(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getBusinessAnalysisReportByGoods(bo));
    }

    @GetMapping(value = "/get/BusinessBigDataSelection")
    public Result getBusinessBigDataSelection(){
        return Result.successResult(businessService.getBusinessBigDataSelection());
    }

    @PostMapping(value = "/get/BusinessSalesRank")
    public Result getBusinessSalesRank(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getBusinessSalesRank(bo));
    }

    @GetMapping(value = "/get/BusinessPriceAdjustSuggest/{storeId}")
    public Result getBusinessPriceAdjustSuggest(@PathVariable int storeId){
        return Result.successResult(businessService.getBusinessPriceAdjustSuggest(storeId));
    }
    @PostMapping(value = "/get/CustomerPurchasedAnalysis")
    public Result getCustomerPurchasedAnalysis(@RequestBody BusinessDateBo bo){
        return Result.successResult(businessService.getCustomerPurchasedAnalysis(bo));
    }

}
